<?php

session_start();
if (!defined('BASEPATH'))
    exit('No direct script access allowed');

/**
 *  Home Class  
 *  
 * @package ANO CMS v2.0 
 * @subpackage News  
 * @author Vui Nguyen - 09/04/2013 
 * @link http://ANO.vn
 */
class News extends CI_Controller {

    /**
     * Contrust class
     *  
     * @access public 
     */
    public function __construct() {
        parent::__construct();
        $this->load->library('smarty3', '', 'smarty');
        $this->load->library('captcha');
        $this->load->library('session');
        $this->load->library('email');
        $this->load->model('kpay/db_news_model');
        $this->news_model = new db_news_model();
    }

    

    //-------------------------------------END----------------------------------------------			
    public function index() {
        
        //$this->smarty->display('template/frontend_live/home');
    }

    public function notice() {
        $user = $this->session->userdata('user_info');
        if($user)
        {
            $this->smarty->assign('user_info', $user);
        }
        
        $this->smarty->assign('menu','notice');
        $this->smarty->view('template/pages_live/banner', 'banner');
        $this->smarty->view('template/pages_live/guide', 'content');
        $this->smarty->display('template/frontend_live/home');
    }
    
    public function guide() {
        $user = $this->session->userdata('user_info');
        if($user)
        {
            $this->smarty->assign('user_info', $user);
        }
        $category = '729';
        $news=$this->news_model->getNewsByCategory($category,'',5);
        
        $this->smarty->assign('menu','guide');
        $this->smarty->assign('news', $news);
        $this->smarty->view('template/pages_live/banner', 'banner');
        $this->smarty->view('template/pages_live/guide', 'content');
        $this->smarty->display('template/frontend_live/home');
    }
    
    public function detail()
    {
        $user = $this->session->userdata('user_info');
        if($user)
        {
            $this->smarty->assign('user_info', $user);
        }
        
        $category = $this->uri->rsegment(3);
        $news_alias = $this->uri->rsegment(4);
        
        $detail = $this->news_model->getNewsDetail($news_alias);
        
        $this->smarty->assign('detail',$detail);
        //$this->smarty->view('template/pages_live/banner', 'banner');
        $this->smarty->view('template/pages_live/detail', 'content');
        $this->smarty->display('template/frontend_live/home');
    }
}

/* End of file admin/cpanel.php */
/* Location: ./system/application/controllers/admin/cpanel.php */